<template>
  <div>
    <p @click="openMap" class="counter">微信内置地图查看位置</p>
    <navigator url="../counter/main" class="counter">微信组件路由跳转</navigator>
    <p @click="to" class="counter">navigateTo路由跳转带参数</p>

    <p @click="get" class="counter">请求数据(在控制台查看请求数据)</p>
    <navigator url="../city/main" class="counter">picker选择器（picker、省市区选择器）</navigator>
    <navigator url="../dictionary/main" class="counter">调用聚合数据(新华字典接口)</navigator>
    <navigator url="../express/main" class="counter">调用聚合数据(快递查询接口)</navigator>

  </div>

</template>

<script>
import card from '@/components/card'
import {mapState, mapMutations,mapActions} from 'vuex'

export default {
  data () {
    return {

    }
  },
  created(){
     this.babyShow();
   },
  components: {
    card
  },
    methods: {
     ...mapActions([
      'babyShow'
    ]),
    get(){
         // this.babyShow();

      },

    to(){
      const url = "../counter/main?id=1";
      wx.navigateTo({ url });
    },
    openMap() {
      let mapInfo = {
        startLat: 121.6695,
        startLng: 31.268726,
        endLat: 31.264907491401107,
        endLng: 121.51072952012122,
        endName: "上海市上海市杨浦区兰州路周家嘴路1333弄"
      };
      wx.openLocation({
        //使用微信内置地图查看位置。
        latitude: Number(mapInfo.endLat), //要去的纬度-地址
        longitude: Number(mapInfo.endLng), //要去的经度-地址
        name: "",
        address: mapInfo.endName
      });
    }
  },



  computed: {
    ...mapState([
      'openId',"list"
    ]),

  },
}
</script>

<style scoped lang="scss">

   .counter{
     width: 100%;
     height: 50px;
     border: 1px solid lawngreen;
     box-sizing: border-box;
     text-align: center;
     line-height: 50px;
     margin-top: 20px;
   }
</style>
